﻿using System;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace Deferred.Editor.Gui
{
    public partial class DeferredWindow : DockContent
    {
        private Control contents;
        public Control Content{
            get
            {
                return contents;
            }
            set
            {
                if (contents != null)
                {
                    this.Controls.Remove(contents);
                    contents.Dispose();
                }
                contents = value;
                contents.Dock = DockStyle.Fill;
                Controls.Add(contents);
                contents.Location = new System.Drawing.Point(0, 0);
            }
        }

        public DeferredWindow(Control contents, String windowName)
        {
            InitializeComponent();

            Content = contents;

            this.Text = windowName;
        }
    }
}
